import 'package:flutter_test/flutter_test.dart';
import 'package:my_plugin_android/my_plugin_android.dart';
import 'package:my_plugin_android/my_plugin_android_platform_interface.dart';
import 'package:my_plugin_android/my_plugin_android_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMyPluginAndroidPlatform
    with MockPlatformInterfaceMixin
    implements MyPluginAndroidPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final MyPluginAndroidPlatform initialPlatform = MyPluginAndroidPlatform.instance;

  test('$MethodChannelMyPluginAndroid is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMyPluginAndroid>());
  });

  test('getPlatformVersion', () async {
    MyPluginAndroid myPluginAndroidPlugin = MyPluginAndroid();
    MockMyPluginAndroidPlatform fakePlatform = MockMyPluginAndroidPlatform();
    MyPluginAndroidPlatform.instance = fakePlatform;

    expect(await myPluginAndroidPlugin.getPlatformVersion(), '42');
  });
}
